package com.hdax.dmw.scheduler.api;

import com.hdax.dmw.dtos.scheduler.PriceDto;
import com.hdax.dmw.scheduler.service.DmSchedulerSeatPriceService;
import com.hdax.dmw.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping(path = "/desc")
public class PriceApi {

    @Autowired
    private DmSchedulerSeatPriceService priceService;

    @PostMapping(path = "/getPrice")
    public Result<List<PriceDto>> getPrice(@RequestBody Map<String, Long> params){
        Long scheduleId = params.get("scheduleId");
        return priceService.getPrice(scheduleId);
    }
}
